import { createI18n } from 'vue-i18n';
import zh from './locales/zh-cn';
import en from './locales/en';
import { storage } from '@/utils';
import { LayoutMutationType } from '@/enums/layoutEnums';

const lang = storage.get(LayoutMutationType.SetLang);

const i18n = createI18n({
    locale: lang || 'zh',
    fallbackLocale: 'en',
    messages: {
        zh,
        en,
    },
});

export default i18n;
